package com.itbaima.pojo.entity;//package com.itbaima.pojo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Column;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "salary_standard")
public class Salary {

    private Double id; // 表ID，自增主键

    @Column(name = "salary_id", nullable = false)
    private Double salary_id; // 薪酬标准id

    @Column(name = "department_id", nullable = false)
    private Double department_id; // 部门ID，所属部门的 ID

//    @Column(name = "salary_standard_code",  unique = true, length = 50)
//    private String salaryStandardCode; // 薪酬标准编号，唯一

    @Column(name = "salary_standard_name", nullable = false, length = 100)
    private String salary_standard_name; // 薪酬标准名称

    @Column(name = "basic_salary", nullable = false, precision = 10, scale = 2)
    private Double basic_salary; // 基本工资

    @Column(name = "allowance", nullable = false, precision = 10, scale = 2)
    private Double allowance; // 补助金额

    @Column(name = "pension_insurance", nullable = false, precision = 10, scale = 2)
    private Double pension_insurance; // 养老保险

    @Column(name = "medical_insurance", nullable = false, precision = 10, scale = 2)
    private Double medical_insurance; // 医疗保险

    @Column(name = "unemployment_insurance", nullable = false, precision = 10, scale = 2)
    private Double unemployment_insurance; // 失业保险

    @Column(name = "housing_fund", nullable = false, precision = 10, scale = 2)
    private Double housing_fund; // 住房公积金

    @Column(name = "total_salary", nullable = false, precision = 10, scale = 2)
    private Double total_salary; // 薪酬总额

    @Column(name = "creator_name", nullable = false, length = 50)
    private String creator_name; // 制定人

    @Column(name = "registrar", nullable = false, length = 50)
    private String registrar; // 登记人

    @Column(name = "registrar_id", nullable = false)
    private Integer registrar_id; // 登记人ID

    @Column(name = "registration_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 格式化时间
    private LocalDateTime registration_time; // 登记时间


}

//import com.fasterxml.jackson.annotation.JsonFormat;
//import jakarta.persistence.Column;
//import jakarta.persistence.Table;
//import lombok.AllArgsConstructor;
//import lombok.Builder;
//import lombok.Data;
//import lombok.NoArgsConstructor;
//
//import java.time.LocalDateTime;
//
//@Data
//@Builder
//@NoArgsConstructor
//@AllArgsConstructor
//@Table(name = "salary_standard")
//public class Salary {
//
//    private Integer id; // 表ID，自增主键
//
//    @Column(name = "department_id", nullable = false)
//    private Integer departmentId; // 部门ID
//
//    @Column(name = "salary_id", nullable = false)
//    private Integer salaryId; // 薪酬标准ID
//
//    @Column(name = "basic_salary", nullable = false, precision = 10, scale = 2)
//    private Double basicSalary; // 基本工资
//
//    @Column(name = "allowance", nullable = false, precision = 10, scale = 2)
//    private Double allowance; // 补助金额
//
//    @Column(name = "pension_insurance", nullable = false, precision = 10, scale = 2)
//    private Double pensionInsurance; // 养老保险
//
//    @Column(name = "medical_insurance", nullable = false, precision = 10, scale = 2)
//    private Double medicalInsurance; // 医疗保险
//
//    @Column(name = "unemployment_insurance", nullable = false, precision = 10, scale = 2)
//    private Double unemploymentInsurance; // 失业保险
//
//    @Column(name = "housing_fund", nullable = false, precision = 10, scale = 2)
//    private Double housingFund; // 住房公积金
//
//    @Column(name = "total_salary", nullable = false, precision = 10, scale = 2)
//    private Double totalSalary; // 薪酬总额
//
//    @Column(name = "creator_name", nullable = false, length = 50)
//    private String creatorName; // 制定人
//
//    @Column(name = "registrar", nullable = false, length = 50)
//    private String registrar; // 登记人
//
//    @Column(name = "registrar_id", nullable = false)
//    private Integer registrarId; // 登记人ID
//
//    @Column(name = "registration_time")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 格式化时间
//    private LocalDateTime registrationTime; // 登记时间
//}